//auto gen by paipai.java.augogen ver 3.0.0
//author skyzhuang
//source idl: com.erp.gis.idl.GisMapGatewayAo.java


#ifndef ERP_GIS_PO_CCOORDINATESQUERYPO_BY_AUTOGEN_V5_H
#define ERP_GIS_PO_CCOORDINATESQUERYPO_BY_AUTOGEN_V5_H


#include "app_platform/intf_serializable.h"
#include <string>
#include <sstream>
#include <iostream>


namespace erp
{
namespace gis
{
namespace po
{


class CCoordinatesQueryPo : public ISerializable
{
	public:
		std::string m_sLastErrMsg;///<错误信息

		/**
		 *  版本号 
		 *
		 * 版本 >= 0
		 */
		uint32_t dwVersion;

		/**
		 * 版本 >= 0
		 */
		uint8_t cVersion_u;

		/**
		 * 送达地省份(可选)
		 *
		 * 版本 >= 0
		 */
		std::string strDestAddrProvince;

		/**
		 * 版本 >= 0
		 */
		uint8_t cDestAddrProvince_u;

		/**
		 * 送达地市(必填)
		 *
		 * 版本 >= 0
		 */
		std::string strDestAddrCity;

		/**
		 * 版本 >= 0
		 */
		uint8_t cDestAddrCity_u;

		/**
		 * 送达地区(可选)
		 *
		 * 版本 >= 0
		 */
		std::string strDestAddrDistrict;

		/**
		 * 版本 >= 0
		 */
		uint8_t cDestAddrDistrict_u;

		/**
		 * 送达地的详细地址(需带省市区详细地址)仅支持UTF8格式输入
		 *
		 * 版本 >= 0
		 */
		std::string strDestAddrDetail;

		/**
		 * 版本 >= 0
		 */
		uint8_t cDestAddrDetail_u;

		/**
		 * 预留扩展字段 
		 *
		 * 版本 >= 0
		 */
		std::string strReserve;

		/**
		 * 版本 >= 0
		 */
		uint8_t cReserve_u;




	public:
		CCoordinatesQueryPo():
		dwVersion(0),
		cVersion_u(0),
		cDestAddrProvince_u(0),
		cDestAddrCity_u(0),
		cDestAddrDistrict_u(0),
		cDestAddrDetail_u(0),
		cReserve_u(0) {}
				CCoordinatesQueryPo& operator = (const CCoordinatesQueryPo& obj){

			this->dwVersion = obj.dwVersion;
			this->cVersion_u = obj.cVersion_u;
			this->strDestAddrProvince = obj.strDestAddrProvince;
			this->cDestAddrProvince_u = obj.cDestAddrProvince_u;
			this->strDestAddrCity = obj.strDestAddrCity;
			this->cDestAddrCity_u = obj.cDestAddrCity_u;
			this->strDestAddrDistrict = obj.strDestAddrDistrict;
			this->cDestAddrDistrict_u = obj.cDestAddrDistrict_u;
			this->strDestAddrDetail = obj.strDestAddrDetail;
			this->cDestAddrDetail_u = obj.cDestAddrDetail_u;
			this->strReserve = obj.strReserve;
			this->cReserve_u = obj.cReserve_u;
			return *this;
		}

	public:


		/**
		 * 是否设置 版本号 了
		 * 
		 * @param uint32_t:dwVersion
		 *  
		 * 
		 */
		 bool  IsVersionSet() const{
				 return  cVersion_u != 0;
		}


		/**
		 * 获取uflag 版本号 了
		 * 
		 * @param uint32_t:dwVersion
		 *  
		 * 
		 */
		 const uint8_t   GetVersionUFlag() const{
				 return  cVersion_u;
		}


		/**
		 * 设置 版本号 
		 * 
		 * @param uint32_t:dwVersion
		 *  
		 * 
		 */
		 void  SetVersion( const uint32_t& sVal, uint8_t cUFlag=1){
				dwVersion = sVal;
				cVersion_u = cUFlag;
		}


		/**
		 * 获取 版本号 
		 * 
		 * @return dwVersion value 类型为:uint32_t
		 * 
		 */
		 const uint32_t&  GetVersion() const {
				return dwVersion;
		}


		/**
		 * 设置
		 * 
		 * 此字段的版本 >= 1
		 * @param uint8_t:cVersion_u
		 *  
		 * 
		 */
		 void  SetVersion_u( const uint8_t& sVal){
				cVersion_u = sVal;
		}


		/**
		 * 获取
		 * 
		 * @return cVersion_u value 类型为:uint8_t
		 * 
		 */
		 const uint8_t&  GetVersion_u() const {
				return cVersion_u;
		}


		/**
		 * 是否设置送达地省份(可选)了
		 * 
		 * @param std::string:strDestAddrProvince
		 *  
		 * 
		 */
		 bool  IsDestAddrProvinceSet() const{
				 return  cDestAddrProvince_u != 0;
		}


		/**
		 * 获取uflag送达地省份(可选)了
		 * 
		 * @param std::string:strDestAddrProvince
		 *  
		 * 
		 */
		 const uint8_t   GetDestAddrProvinceUFlag() const{
				 return  cDestAddrProvince_u;
		}


		/**
		 * 设置送达地省份(可选)
		 * 
		 * @param std::string:strDestAddrProvince
		 *  
		 * 
		 */
		 void  SetDestAddrProvince( const std::string& sVal, uint8_t cUFlag=1){
				strDestAddrProvince = sVal;
				cDestAddrProvince_u = cUFlag;
		}


		/**
		 * 获取送达地省份(可选)
		 * 
		 * @return strDestAddrProvince value 类型为:std::string
		 * 
		 */
		 const std::string&  GetDestAddrProvince() const {
				return strDestAddrProvince;
		}


		/**
		 * 获取送达地省份(可选)
		 * 
		 * @return strDestAddrProvince value 类型为:std::string
		 * 
		 */
		 std::string&  GetDestAddrProvince() {
				return strDestAddrProvince;
		}


		/**
		 * 设置
		 * 
		 * 此字段的版本 >= 1
		 * @param uint8_t:cDestAddrProvince_u
		 *  
		 * 
		 */
		 void  SetDestAddrProvince_u( const uint8_t& sVal){
				cDestAddrProvince_u = sVal;
		}


		/**
		 * 获取
		 * 
		 * @return cDestAddrProvince_u value 类型为:uint8_t
		 * 
		 */
		 const uint8_t&  GetDestAddrProvince_u() const {
				return cDestAddrProvince_u;
		}


		/**
		 * 是否设置送达地市(必填)了
		 * 
		 * @param std::string:strDestAddrCity
		 *  
		 * 
		 */
		 bool  IsDestAddrCitySet() const{
				 return  cDestAddrCity_u != 0;
		}


		/**
		 * 获取uflag送达地市(必填)了
		 * 
		 * @param std::string:strDestAddrCity
		 *  
		 * 
		 */
		 const uint8_t   GetDestAddrCityUFlag() const{
				 return  cDestAddrCity_u;
		}


		/**
		 * 设置送达地市(必填)
		 * 
		 * @param std::string:strDestAddrCity
		 *  
		 * 
		 */
		 void  SetDestAddrCity( const std::string& sVal, uint8_t cUFlag=1){
				strDestAddrCity = sVal;
				cDestAddrCity_u = cUFlag;
		}


		/**
		 * 获取送达地市(必填)
		 * 
		 * @return strDestAddrCity value 类型为:std::string
		 * 
		 */
		 const std::string&  GetDestAddrCity() const {
				return strDestAddrCity;
		}


		/**
		 * 获取送达地市(必填)
		 * 
		 * @return strDestAddrCity value 类型为:std::string
		 * 
		 */
		 std::string&  GetDestAddrCity() {
				return strDestAddrCity;
		}


		/**
		 * 设置
		 * 
		 * 此字段的版本 >= 1
		 * @param uint8_t:cDestAddrCity_u
		 *  
		 * 
		 */
		 void  SetDestAddrCity_u( const uint8_t& sVal){
				cDestAddrCity_u = sVal;
		}


		/**
		 * 获取
		 * 
		 * @return cDestAddrCity_u value 类型为:uint8_t
		 * 
		 */
		 const uint8_t&  GetDestAddrCity_u() const {
				return cDestAddrCity_u;
		}


		/**
		 * 是否设置送达地区(可选)了
		 * 
		 * @param std::string:strDestAddrDistrict
		 *  
		 * 
		 */
		 bool  IsDestAddrDistrictSet() const{
				 return  cDestAddrDistrict_u != 0;
		}


		/**
		 * 获取uflag送达地区(可选)了
		 * 
		 * @param std::string:strDestAddrDistrict
		 *  
		 * 
		 */
		 const uint8_t   GetDestAddrDistrictUFlag() const{
				 return  cDestAddrDistrict_u;
		}


		/**
		 * 设置送达地区(可选)
		 * 
		 * @param std::string:strDestAddrDistrict
		 *  
		 * 
		 */
		 void  SetDestAddrDistrict( const std::string& sVal, uint8_t cUFlag=1){
				strDestAddrDistrict = sVal;
				cDestAddrDistrict_u = cUFlag;
		}


		/**
		 * 获取送达地区(可选)
		 * 
		 * @return strDestAddrDistrict value 类型为:std::string
		 * 
		 */
		 const std::string&  GetDestAddrDistrict() const {
				return strDestAddrDistrict;
		}


		/**
		 * 获取送达地区(可选)
		 * 
		 * @return strDestAddrDistrict value 类型为:std::string
		 * 
		 */
		 std::string&  GetDestAddrDistrict() {
				return strDestAddrDistrict;
		}


		/**
		 * 设置
		 * 
		 * 此字段的版本 >= 1
		 * @param uint8_t:cDestAddrDistrict_u
		 *  
		 * 
		 */
		 void  SetDestAddrDistrict_u( const uint8_t& sVal){
				cDestAddrDistrict_u = sVal;
		}


		/**
		 * 获取
		 * 
		 * @return cDestAddrDistrict_u value 类型为:uint8_t
		 * 
		 */
		 const uint8_t&  GetDestAddrDistrict_u() const {
				return cDestAddrDistrict_u;
		}


		/**
		 * 是否设置送达地的详细地址(需带省市区详细地址)仅支持UTF8格式输入了
		 * 
		 * @param std::string:strDestAddrDetail
		 *  
		 * 
		 */
		 bool  IsDestAddrDetailSet() const{
				 return  cDestAddrDetail_u != 0;
		}


		/**
		 * 获取uflag送达地的详细地址(需带省市区详细地址)仅支持UTF8格式输入了
		 * 
		 * @param std::string:strDestAddrDetail
		 *  
		 * 
		 */
		 const uint8_t   GetDestAddrDetailUFlag() const{
				 return  cDestAddrDetail_u;
		}


		/**
		 * 设置送达地的详细地址(需带省市区详细地址)仅支持UTF8格式输入
		 * 
		 * @param std::string:strDestAddrDetail
		 *  
		 * 
		 */
		 void  SetDestAddrDetail( const std::string& sVal, uint8_t cUFlag=1){
				strDestAddrDetail = sVal;
				cDestAddrDetail_u = cUFlag;
		}


		/**
		 * 获取送达地的详细地址(需带省市区详细地址)仅支持UTF8格式输入
		 * 
		 * @return strDestAddrDetail value 类型为:std::string
		 * 
		 */
		 const std::string&  GetDestAddrDetail() const {
				return strDestAddrDetail;
		}


		/**
		 * 获取送达地的详细地址(需带省市区详细地址)仅支持UTF8格式输入
		 * 
		 * @return strDestAddrDetail value 类型为:std::string
		 * 
		 */
		 std::string&  GetDestAddrDetail() {
				return strDestAddrDetail;
		}


		/**
		 * 设置
		 * 
		 * 此字段的版本 >= 1
		 * @param uint8_t:cDestAddrDetail_u
		 *  
		 * 
		 */
		 void  SetDestAddrDetail_u( const uint8_t& sVal){
				cDestAddrDetail_u = sVal;
		}


		/**
		 * 获取
		 * 
		 * @return cDestAddrDetail_u value 类型为:uint8_t
		 * 
		 */
		 const uint8_t&  GetDestAddrDetail_u() const {
				return cDestAddrDetail_u;
		}


		/**
		 * 是否设置预留扩展字段 了
		 * 
		 * @param std::string:strReserve
		 *  
		 * 
		 */
		 bool  IsReserveSet() const{
				 return  cReserve_u != 0;
		}


		/**
		 * 获取uflag预留扩展字段 了
		 * 
		 * @param std::string:strReserve
		 *  
		 * 
		 */
		 const uint8_t   GetReserveUFlag() const{
				 return  cReserve_u;
		}


		/**
		 * 设置预留扩展字段 
		 * 
		 * @param std::string:strReserve
		 *  
		 * 
		 */
		 void  SetReserve( const std::string& sVal, uint8_t cUFlag=1){
				strReserve = sVal;
				cReserve_u = cUFlag;
		}


		/**
		 * 获取预留扩展字段 
		 * 
		 * @return strReserve value 类型为:std::string
		 * 
		 */
		 const std::string&  GetReserve() const {
				return strReserve;
		}


		/**
		 * 获取预留扩展字段 
		 * 
		 * @return strReserve value 类型为:std::string
		 * 
		 */
		 std::string&  GetReserve() {
				return strReserve;
		}


		/**
		 * 设置
		 * 
		 * 此字段的版本 >= 1
		 * @param uint8_t:cReserve_u
		 *  
		 * 
		 */
		 void  SetReserve_u( const uint8_t& sVal){
				cReserve_u = sVal;
		}


		/**
		 * 获取
		 * 
		 * @return cReserve_u value 类型为:uint8_t
		 * 
		 */
		 const uint8_t&  GetReserve_u() const {
				return cReserve_u;
		}

		virtual bool Serialize(CByteStreamNetwork& bs){
		
			uint32_t dwMyLen = 0;
			if(bs.isStoring()) //for write in buffer
			{
				//can not larger than 1 M.
				CByteStreamNetwork bsDummy(NULL, 1024 * 1024, false);
				//bsDummy for precheck the xo size...
				bsDummy.isStoring(true);
				Serialize_i(bsDummy);
				dwMyLen = bsDummy.getWrittenLength();
				bs & dwMyLen;
				Serialize_i(bs);
			}
			else
			{    //for read from buffer
				bs & dwMyLen;
				uint32_t dwReadedLen = bs.getReadLength();
				Serialize_i(bs);
				dwReadedLen = bs.getReadLength() - dwReadedLen;
				// dwReadedLen for the size of xo
				if( dwReadedLen > dwMyLen ){
					return false;
				}
				//go through the unwanted mem position...
				bs.goForward( dwMyLen - dwReadedLen );
			}

			return bs.isGood();
		}

		bool Serialize_i(CByteStreamNetwork& bsTmp){

			uint32_t dwVersionTmp = dwVersion;
			bsTmp & dwVersionTmp; // 序列化 版本号  类型为uint32_t
			bsTmp & cVersion_u; // 序列化 类型为uint8_t
			bsTmp & strDestAddrProvince; // 序列化送达地省份(可选) 类型为String
			bsTmp & cDestAddrProvince_u; // 序列化 类型为uint8_t
			bsTmp & strDestAddrCity; // 序列化送达地市(必填) 类型为String
			bsTmp & cDestAddrCity_u; // 序列化 类型为uint8_t
			bsTmp & strDestAddrDistrict; // 序列化送达地区(可选) 类型为String
			bsTmp & cDestAddrDistrict_u; // 序列化 类型为uint8_t
			bsTmp & strDestAddrDetail; // 序列化送达地的详细地址(需带省市区详细地址)仅支持UTF8格式输入 类型为String
			bsTmp & cDestAddrDetail_u; // 序列化 类型为uint8_t
			bsTmp & strReserve; // 序列化预留扩展字段  类型为String
			bsTmp & cReserve_u; // 序列化 类型为uint8_t
			return bsTmp.isGood();
		}

		const char* GetLastErrMsg() const{
			return m_sLastErrMsg.c_str();
		}

		bool VerifyCoordinatesQueryPo(){

			if(!IsVersionSet()){
				m_sLastErrMsg = "Miss Param:version";
				return false;
			}

			if(!IsDestAddrProvinceSet()){
				m_sLastErrMsg = "Miss Param:destAddrProvince";
				return false;
			}

			if(!IsDestAddrCitySet()){
				m_sLastErrMsg = "Miss Param:destAddrCity";
				return false;
			}

			if(!IsDestAddrDistrictSet()){
				m_sLastErrMsg = "Miss Param:destAddrDistrict";
				return false;
			}

			if(!IsDestAddrDetailSet()){
				m_sLastErrMsg = "Miss Param:destAddrDetail";
				return false;
			}

			if(!IsReserveSet()){
				m_sLastErrMsg = "Miss Param:reserve";
				return false;
			}
			return true;
		}

		void DumpData(std::ostream& oss) const{
		
			oss<<"[dwVersion:"<<dwVersion<<"] ";
			oss<<"[cVersion_u:"<<(int)cVersion_u<<"] ";
			oss<<"[strDestAddrProvince:"<<strDestAddrProvince<<"] ";
			oss<<"[cDestAddrProvince_u:"<<(int)cDestAddrProvince_u<<"] ";
			oss<<"[strDestAddrCity:"<<strDestAddrCity<<"] ";
			oss<<"[cDestAddrCity_u:"<<(int)cDestAddrCity_u<<"] ";
			oss<<"[strDestAddrDistrict:"<<strDestAddrDistrict<<"] ";
			oss<<"[cDestAddrDistrict_u:"<<(int)cDestAddrDistrict_u<<"] ";
			oss<<"[strDestAddrDetail:"<<strDestAddrDetail<<"] ";
			oss<<"[cDestAddrDetail_u:"<<(int)cDestAddrDetail_u<<"] ";
			oss<<"[strReserve:"<<strReserve<<"] ";
			oss<<"[cReserve_u:"<<(int)cReserve_u<<"] ";
		
		}

		// codydeng提供,非常好的dump方法 ^-^  。。。。。
		template<typename T>
		T & DumpPlusData(T& oss){
			oss<<"dwVersion:"<<dwVersion;
			oss<<"cVersion_u:"<<cVersion_u;
			oss<<"strDestAddrProvince:"<<strDestAddrProvince;
			oss<<"cDestAddrProvince_u:"<<cDestAddrProvince_u;
			oss<<"strDestAddrCity:"<<strDestAddrCity;
			oss<<"cDestAddrCity_u:"<<cDestAddrCity_u;
			oss<<"strDestAddrDistrict:"<<strDestAddrDistrict;
			oss<<"cDestAddrDistrict_u:"<<cDestAddrDistrict_u;
			oss<<"strDestAddrDetail:"<<strDestAddrDetail;
			oss<<"cDestAddrDetail_u:"<<cDestAddrDetail_u;
			oss<<"strReserve:"<<strReserve;
			oss<<"cReserve_u:"<<cReserve_u;
			return oss;
		}

		// wileywang提供,树形dump方法 ^-^  。。。。。
		void DumpDataTree(std::ostream& os, int ident = 0)const {
			g_pprint(os, "dwVersion", dwVersion, ident);
			g_pprint(os, "cVersion_u", cVersion_u, ident);
			g_pprint(os, "strDestAddrProvince", strDestAddrProvince, ident);
			g_pprint(os, "cDestAddrProvince_u", cDestAddrProvince_u, ident);
			g_pprint(os, "strDestAddrCity", strDestAddrCity, ident);
			g_pprint(os, "cDestAddrCity_u", cDestAddrCity_u, ident);
			g_pprint(os, "strDestAddrDistrict", strDestAddrDistrict, ident);
			g_pprint(os, "cDestAddrDistrict_u", cDestAddrDistrict_u, ident);
			g_pprint(os, "strDestAddrDetail", strDestAddrDetail, ident);
			g_pprint(os, "cDestAddrDetail_u", cDestAddrDetail_u, ident);
			g_pprint(os, "strReserve", strReserve, ident);
			g_pprint(os, "cReserve_u", cReserve_u, ident);
		}
		
		//提供ToString借口，默认为DumpData格式，请按需要进行修改
		std::string ToString() const{
			std::stringstream ss;
			DumpData(ss);
			return ss.str();
		}

/**
 ********************以下信息是每个版本的字段********************
 */

};

}
}
}

#endif /* ERP_GIS_PO_CCOORDINATESQUERYPO_BY_AUTOGEN_V5_H */
